package main.model.hexisland;

/**
 * An Enum to translate the numerical representations of directions for adjacent tiles into words
 */
public enum AdjacentBearing{
    EAST       (0), NORTH_EAST (1),
    NORTH_WEST (2), WEST       (3),
    SOUTH_WEST (4), SOUTH_EAST (5);

    private int bearingValue;

    private AdjacentBearing(int bearing){ this.bearingValue = bearing;}

    public int getBearingValue(){ return bearingValue; }

    public int getOppositeBearingValue(){
        if(bearingValue+3 >= 6) return bearingValue -3;
        else return bearingValue +3;
    }

    public AdjacentBearing getOppositeBearing(){
        int value = getOppositeBearingValue();
        for(AdjacentBearing bearing : AdjacentBearing.values()){
            if(bearing.getBearingValue() == value){
                return bearing;
            }
        }
        return EAST;
    }
}